home *** CD-ROM | disk | FTP | other *** search
/ PCMania 19 / PCMania19.iso / Jogos em Flash / CARTAS / TAROT.SWF / scripts / frame_46 / DoAction_2.as next >
Text File  |  2003-11-17  |  2KB  |  66 lines

  1. function ordercards()
  2. {
  3.    listnumber = new Array();
  4.    orderelement = new Array();
  5.    t = 0;
  6.    while(21 >= t)
  7.    {
  8.       listnumber[t] = t;
  9.       t++;
  10.    }
  11.    t = 0;
  12.    while(21 >= t)
  13.    {
  14.       orderelement[t] = listnumber.splice(Math.floor(Math.random() * listnumber.length),1);
  15.       t++;
  16.    }
  17. }
  18. function duplicatecards(framerotation)
  19. {
  20.    if(nbrcards != 22)
  21.    {
  22.       doscarte._rotation = rotation.angle._rotation;
  23.       doscarte._x = rotation._x + rotation.angle._x;
  24.       doscarte._y = rotation._y;
  25.    }
  26.    if(Math.floor(framerotation % ((rotation._totalframes - 12) / 22)) == 1)
  27.    {
  28.       if(nbrcards == 0)
  29.       {
  30.          setProperty(cartes.carte0, _rotation, rotation.angle._rotation);
  31.          setProperty(cartes.carte0, _X, rotation.angle._x);
  32.          cartes.carte0.cardnbr = _root.orderelement[0];
  33.          setProperty("cartes.carte0.btncarte", _visible, false);
  34.          setProperty("cartes.carte0.btncarteinterpretation", _visible, false);
  35.          nbrcards++;
  36.          _root.cartes._visible = true;
  37.       }
  38.       else
  39.       {
  40.          levelcard++;
  41.          duplicateMovieClip(cartes.carte0,"carte" + nbrcards,16384 + levelcard);
  42.          setProperty(String("cartes.carte" + nbrcards), _rotation, rotation.angle._rotation);
  43.          setProperty(String("cartes.carte" + nbrcards), _X, rotation.angle._x);
  44.          set(String("cartes.carte" + nbrcards) + "/:cardnbr",_root.orderelement[nbrcards]);
  45.          setProperty("cartes.carte" + nbrcards + ".btncarte", _visible, false);
  46.          setProperty("cartes.carte" + nbrcards + ".btncarteinterpretation", _visible, false);
  47.          nbrcards++;
  48.       }
  49.    }
  50. }
  51. function carteschoisies(numcarte)
  52. {
  53.    _root.numcarteschoisies.push(parseInt(numcarte));
  54.    _root.ejectcartes.push(parseInt(numcarte));
  55.    if(_root.numcarteschoisies.length == 2)
  56.    {
  57.       t = 0;
  58.       while(21 >= t)
  59.       {
  60.          eval("cartes.carte" + t + ".btncarte")._visible = false;
  61.          t++;
  62.       }
  63.       messages.play();
  64.    }
  65. }
  66.